body {
    font-family: 'Fredoka', sans-serif;
    background-color: #fdf2f8; /* Lighter pink */
    color: #555;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align to top to see content better */
    min-height: 100vh;
    margin: 0;
    padding: 2em 0;
}

#game-container {
    background: white;
    padding: 2em 3em;
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    max-width: 900px;
    width: 90%;
    border: 5px solid #fff;
}

h1 {
    color: #f43f5e; /* Rose 500 */
    font-size: clamp(2.5em, 5vw, 3.5em);
    margin-bottom: 0.5em;
    font-weight: 600;
}

h2 {
    color: #a855f7; /* Purple 500 */
    border-bottom: 4px solid #f3e8ff; /* Purple 100 */
    padding-bottom: 0.5em;
    margin-top: 2em;
    font-weight: 500;
}

#gacha-area {
    position: relative;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-bottom: 2em;
}

#gacha-prompt {
    font-size: 1.2em;
    color: #777;
}

#box-container img {
    cursor: pointer;
    width: 200px;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#box-container img:hover {
    transform: scale(1.1) rotate(5deg);
}

#box-container img.opening {
    animation: shake 0.5s infinite;
}

@keyframes shake {
    0%, 100% { transform: translateX(0) rotate(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px) rotate(-3deg); }
    20%, 40%, 60%, 80% { transform: translateX(5px) rotate(3deg); }
}

/* Reveal modal styling */
#reveal-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(5px);
}

#reveal-modal.hidden {
    display: none;
}

#reveal-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2em;
    animation: pop-in 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}


@keyframes pop-in {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

#revealed-labubu-img {
    width: 280px;
    height: 280px;
    object-fit: contain;
}

#revealed-labubu-name {
    color: white;
    font-size: 2.5em;
    margin-top: 0.5em;
    margin-bottom: 0;
    font-weight: 600;
    text-shadow: 3px 3px 6px #000;
}

#revealed-labubu-rarity {
    font-size: 1.2em;
    margin-top: 0.2em;
    padding: 0.3em 1em;
    border-radius: 20px;
    color: white;
    text-transform: uppercase;
    font-weight: 500;
}

#revealed-labubu-rarity.Common { background-color: #60a5fa; }
#revealed-labubu-rarity.Rare { background-color: #a78bfa; }
#revealed-labubu-rarity.Super-Rare { background-color: #facc15; }

#revealed-emoji-display {
    font-size: 180px;
    line-height: 1;
    margin-bottom: 30px;
    text-shadow: 3px 5px 10px rgba(0,0,0,0.3);
    animation: emoji-reveal-anim 0.5s 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

@keyframes emoji-reveal-anim {
    from { transform: scale(0.2) rotate(-30deg); opacity: 0; }
    to { transform: scale(1) rotate(0); opacity: 1; }
}

#revealed-emoji-name {
    color: white;
    font-size: 2.5em;
    margin-top: 0.5em;
    margin-bottom: 0;
    font-weight: 600;
    text-shadow: 3px 3px 6px #000;
}

#revealed-emoji-rarity {
    font-size: 1.2em;
    margin-top: 0.2em;
    padding: 0.3em 1em;
    border-radius: 20px;
    color: white;
    text-transform: uppercase;
    font-weight: 500;
}

#revealed-emoji-rarity.Common { background-color: #60a5fa; }
#revealed-emoji-rarity.Rare { background-color: #a78bfa; }
#revealed-emoji-rarity.Super-Rare { background-color: #facc15; }

#close-reveal-btn {
    font-family: 'Fredoka', sans-serif;
    font-weight: 500;
    font-size: 1.2em;
    padding: 0.8em 2em;
    margin-top: 1.5em;
    border: none;
    background-color: #f43f5e;
    color: white;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

#close-reveal-btn:hover {
    background-color: #be123c;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}


#collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 20px;
    margin-top: 2em;
}

.collection-slot {
    background: #f3e8ff;
    border: 3px dashed #d8b4fe;
    border-radius: 15px;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 10px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.collection-slot-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: all 0.4s ease;
}

.collection-slot.unlocked .collection-slot-img {
    filter: brightness(0.1) opacity(0.3);
}

.collection-slot.collected {
    background: #e0f2fe;
    border-color: #7dd3fc;
    border-style: solid;
}

.collection-slot.collected .collection-slot-img {
   filter: none;
   opacity: 1;
}

.collection-slot:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.collection-slot-emoji {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 5vw;
    min-font-size: 40px;
    line-height: 1;
    transition: all 0.4s ease;
}

.collection-slot.unlocked .collection-slot-emoji {
    transform: scale(0.9);
}

.collection-slot.collected .collection-slot-emoji {
   transform: scale(1);
}

.labubu-name-plate {
    font-size: 0.9em;
    font-weight: 500;
    color: #444;
    position: absolute;
    bottom: 8px;
    background: rgba(255, 255, 255, 0.8);
    padding: 3px 8px;
    border-radius: 10px;
    width: 90%;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.collection-slot.unlocked .labubu-name-plate {
    color: #888;
    background: rgba(230, 230, 230, 0.8);
}

.emoji-name-plate {
    font-size: 0.9em;
    font-weight: 500;
    color: #444;
    position: absolute;
    bottom: 8px;
    background: rgba(255, 255, 255, 0.8);
    padding: 3px 8px;
    border-radius: 10px;
    width: 90%;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.collection-slot.unlocked .emoji-name-plate {
    color: #888;
    background: rgba(230, 230, 230, 0.8);
}